import {FormItemRule} from "naive-ui";

export const formInfo = {
    // 标题
    title: ``,
    // 活动图
    image: ``,
    // 活动内容
    content: ``,
    // 发布等级(社区、区(县)、市)
    grade: 0,
}

export const rulesInfo = {
    title: {
        required: true,
        validator (rule: FormItemRule, value: string) {
            if (!value) {
                return new Error('标题为必填项')
            }
            return true
        },
        trigger: ['input', 'blur']
    },
    content: {
        required: true,
        validator (rule: FormItemRule, value: string) {
            if (!value) {
                return new Error('活动内容为必填项')
            }
            return true
        },
        trigger: ['input', 'blur']
    },
}
